<section class="content">
    <div class="row">
        <div class="col-12">
            <div class="card">
                <div class="card-header">
                    <h3 class="card-title">后台用户列表
                        <a class="btn" href="{:U('user_add')}">
                            <i class="fa fa-plus"></i> 添加
                        </a>
                    </h3>
                    <div class="card-tools">
                        <div class="input-group input-group-sm" style="width: 150px;">
                            <input type="hidden" name="s" value="<?php echo MODULE_NAME . '/' . CONTROLLER_NAME . '/' . ACTION_NAME; ?>"/>
                            <input type="text" name="keywords" class="form-control float-right" placeholder="请输入关键字">

                            <div class="input-group-append">
                                <button type="submit" class="btn btn-default"><i class="fa fa-search"></i></button>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="card-body">
                    <table id="example2" class="table table-bordered table-hover">
                        <thead>
                            <tr>
                                <th width="100" >ID</th>
                                <th>用户名</th>
                                <th>邮箱</th>
                                <th>手机</th>
                                <th>昵称</th>
                                <th>后台权限</th>
<!--                                <th>前台权限</th>
                                <th>接口权限</th>-->
                                <th width="15%">添加时间</th>
                                <th width="20%">操作</th>
                            </tr>
                        </thead>
                        <tbody>
                        <foreach name="list" item="v">
                            <tr>
                                <td >{$v.id}</td>
                                <td>{$v.username|replace_keywords=I('get.keywords'),###}</td>
                                <td>{$v.email|replace_keywords=I('get.keywords'),###}</td>
                                <td>{$v.phone|replace_keywords=I('get.keywords'),###}</td>
                                <td>{$v.nickname}</td>
                                <td>{$v.admin_group_info.name}<?php if($v['admin_group'] > 1){ echo $v['admin_group_leader'] ? '['.'全部'.']' : '['.'自己'.']'; } ?></td>
<!--                                <td>{$v.home_group_info.name}</td>
                                <td>{$v.api_group_info.name}</td>-->
                                <td>{$v.ad_time|date="Y-m-d H:i:s",###}</td>
                                <td>
                                    <div class="button-group">
                                        <a class="btn" href="{:U('user_save',array('id'=>$v['id']))}"><i class="fa fa-edit"></i>修改</a> 
                                        <a class="btn" href="javascript:void(0)" onclick="return del('{:U('user_del',array('id'=>$v['id']))}')"><i class="fa fa-trash-o fa-lg"></i>删除</a>
                                    </div>
                                </td>
                            </tr>
                        </foreach>
                        </tbody>
                    </table>
                </div>
                <div class="card-footer clearfix">
                    {$page}
                </div>
            </div>
        </div>
    </div>
</section>
<script type="text/javascript">
    function del(url) {
        if (confirm("您确定要删除吗?")) {
            window.location = url;
        }
    }
</script>